﻿using System;
using System.ComponentModel.DataAnnotations;
using Table = System.Data.Linq.Mapping.TableAttribute;
using Column = System.Data.Linq.Mapping.ColumnAttribute;

namespace DistanceLearning.Models
{
    public class LocalPasswordModel
    {
        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Current password")]
        public string OldPassword { get; set; }

        [Required]
        [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "New password")]
        public string NewPassword { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirm new password")]
        [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }
    }

    public class LoginModel
    {
        [Required]
        [Display(Name = "Имя пользователя")]
        public string UserName { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Пароль")]
        public string Password { get; set; }

        [Display(Name = "Запомнить?")]
        public bool RememberMe { get; set; }
    }

    public class RegisterModel
    {
        [Required]
        [Display(Name = "Никнейм")]
        public string UserName { get; set; }

        [Obsolete]
        [Required]
        [Display(Name = "Учебное заведение")]
        public int SchoolId { get; set; }

        [Required]
        [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "Пароль")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Подтвердите пароль")]
        [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }

        [StringLength(40)]
        [Display(Name = "Имя")]
        public string FirstName { get; set; }

        [StringLength(40)]
        [Display(Name = "Фамилия")]
        public string LastName { get; set; }

        [StringLength(40)]
        [Display(Name = "Отчество")]
        public string PatronymicName { get; set; }

        [Display(Name = "Дата рождения")]
        public DateTime DateOfBirth { get; set; }

        [Display(Name = "E-mail пользователя")]
        public string Email { get; set; }

        [Display(Name = "Отправить письмо на e-mail")]
        public bool SendEmail { get; set; }
    }
}
